#set( $page_title = "红包退款" )
<div>
    <div style="font-size: 24px; color: #333333;">红包退款</div>
    <div style="border-top: 1px solid #e7e7e7; margin-top: 20px;"></div>
    <div style="margin-top: 20px;">
         <form action="$!{velocityCommonUtil.getAbsoluteURL()}/hongbaoRefund.html" method="get">
                    <span style="color: #747474;">退款商户名称：</span><input type="text" name="shopName" value="$!{shopName}"> 
                    <span style="color: #747474;">订单号：</span><input type="text" name="toOuterId"  value="$!{toOuterId}"   style="width: 280px;"> 
                    <input type="submit" class="btn   btn-danger"  value="搜索" style="height: 30px; width: 60px;" />
                </form>
    </div>
    <div style="margin-top: 20px;">
        <table class="table" cellPadding="0" cellSpacing="0" style="width: 100%;">
            <thead style="font-size: 14px;">
                <tr>
                    <th style="width: 13%;">申请时间</th>
                    <th style="width: 13%;">订单号</th>
                    <th style="width: 13%;">红包名称</th>
                    <th style="width: 10%;">退款个数</th>
                    <th style="width: 10%;">退款金额</th>
                    <th style="width: 12%;">店铺名称</th>
                    <th style="width: 11%;">退款理由</th>
                    <th style="width: 10%;">状态</th>
                    <th style="width: 8%;">操作</th>
                </tr>
            </thead>
          <tbody  style="font-size: 12px;">
               #foreach ($refundOrder in $refundOrders)
                <tr>
                    <th style="width: 13%;">$date.format('yyyy-MM-dd HH:mm:ss',$refundOrder.createdAt)</th>
                    <th style="width: 13%;">$!refundOrder.toOuterId</th>
                    <th style="width: 13%;">$!refundOrder.refundOrderDetails.get(0).hongbao.name</th>
                    <th style="width: 10%;">$!refundOrder.totalNum</th>
                    <th style="width: 10%;">$price.feng2DotYuan($!refundOrder.totalAmount)</th>
                    <th style="width: 12%;">$!refundOrder.shop.name</th>
                    <th style="width: 11%;">$!refundOrder.reason</th>
                    <th style="width: 10%;">$velocityBizUtil.refundOrderStatus($!refundOrder.status)</th>
                    <th style="width: 8%;">#if(${refundOrder.status} == 2)<a href="javascript:hongbaoRefund('$!{refundOrder.id}')"  class="anormalLink"  >退款</a>#end</th>
                </tr>
                #end
            </tbody>
        </table>
        
         <div  align="right">
                $velocityCommonUtil.pageInfo($pageInfo)
         </div>
         
    </div>
</div>

<script type="text/javascript">
function hongbaoRefund (refundOrderId) {
    YTLib.doAjaxRequest({
        url : "$!{velocityCommonUtil.getAbsoluteURL()}/hongbaoRefundUrl",
        data : {refundOrderId:refundOrderId},
        loading:true
    }, function(res) {
        if(res.data && res.data.url ){
              location.href = res.data.url ;
        }
    });
}
</script>




